package com.hongyue.job;

import java.util.Collections;
import java.util.TreeSet;

public class Demo {
    public static void main(String[] args) {
        TreeSet<Integer> in = new TreeSet<>((o1, o2) -> o1 - o2);
        Collections.addAll(in, 1, 7, 6, 3, 9, 8, 5, 2, 4);
        System.out.println("in = " + in);
        Integer[] a = new Integer[in.size()];
        in.toArray(a);
        System.out.println("a = " + a);
    }
}
